<template>
	<view class="my-search-container" @click="btnSearch">
		<view class="my-search-box">
			<image src="../../static/search_img.png" class="search-img" />
			<view class="search-hint">请输入</view>
			<view class="search-text">搜索</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				wh: 0,
			};
		},
		onLoad() {
			const sysInfo = uni.getSystemInfoSync();
			// 可用高度 = 屏幕高度 - navigationBar高度 - tabBar高度 - 自定义的search组件高度
			this.wh = sysInfo.windowHeight - 50;
		},
		methods: {
			btnSearch() {
				//点击处理
				console.log("搜索点击")
				this.$emit('click')
			}
		},
	};
</script>

<style lang="scss">
	.my-search-container {
		width: 100%;
		background-color: #00aaff;
		height: 66rpx;
		padding: 20rpx;
	}

	.my-search-box {
		display: flex;
		height: 60rpx;
		justify-content: space-between;
		align-items: center;
		background: #fff;
		margin-left: 16rpx;
		margin-right: 32rpx;
		border-radius: 16rpx;
		padding-left: 16rpx;
		padding-right: 16rpx;
	}

	.search-text {
		text-align: center;
		background: #007AFF;
		border-radius: 10px;
		padding: 1px 16px;
		color: #fff;
		display: flex;
		align-items: center;
		font-size: 16px;
	}

	.search-hint {
		font-size: 16px;
		color: #646464;
	}

	.search-img {
		width: 24px;
		height: 24px;
	}
</style>